//
// Created by liushuai on 18-7-17.
//

#include "List.hpp"
#include <iostream>
const int MAX = 30;
template <typename T>
List<T>::List() {
    length = 0;
    T *data = new T[MAX];
}
template <typename T>
List<T>::List(const int l) {
    length = l;
    T *data = new T[MAX];
}
template  <typename T>
List<T>::List(const int l, T *d) {
    length = l;
    T *data = new T[l];
    data = &d;
}
template <typename T>
void List<T>::clear() {
    for(int i = 0;i<length;i++)
    {
        data[i] = 0;
    }
    length = 0;

}
template <typename  T>
bool List<T>::append(const T value) {
    if(length==MAX) {
        std::cerr << "达到队列最大长度，无法插入" << std::endl;
        return false;
    }
    else
    {
        data[length] = value;
        length += 1;
        return true;
    }
}
template <typename T>
bool List::getPos(int *p, const T value) {

}